package com.codemart.lanze.common.base.controller;

import javax.servlet.http.HttpServletRequest;

import com.codemart.lanze.core.utils.UserAgentUtils;

public class FrontBaseController extends BaseController {

	public static final String PREFIX = "/front/";
	// public static final String PREFIX = "";

	public String getTemplatePath(HttpServletRequest request) throws Exception {
		String templatePath = "";
		/**
		 * 1.页面地址中包含了"redirect:"这个关键字的就执行模板加载判断 2.判断是否是手机或平板跳转到对应模板
		 */
		if (UserAgentUtils.isMobileOrTablet(request)) {
			templatePath = "mobile/";
		} else {
			templatePath = "pc/";
		}
		return templatePath;
	}

}
